<?php

use App\Http\Traits\GitLabTrait;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class AddColumnLastShaIdToRepoSettings extends Migration
{
    use GitLabTrait, \App\Http\Traits\UserTrait, \App\Http\Traits\CacheTrait;

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('repo_settings', function (Blueprint $table) {
            $table->string('last_sha_id')->after('name')->comment('最后一次部署时提交的sha-id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('repo_settings', function (Blueprint $table) {
            $table->dropColumn('last_sha_id');
        });
    }
}
